// PersistentCreate.h: interface for the PersistentCreate class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PERSISTENTCREATE_H__20D6C800_0398_4241_A305_B1E4EF6BD2F1__INCLUDED_)
#define AFX_PERSISTENTCREATE_H__20D6C800_0398_4241_A305_B1E4EF6BD2F1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "PersistentVisitor.h"

namespace PersistentObjectOperation
{
	class DllExport PersistentCreate : public PersistentVisitor 
	{
	public:
		PersistentCreate();
		virtual ~PersistentCreate();

	public:
		virtual BOOL Visit(Volume*& pVolume);
		virtual BOOL Visit(Part*& pPart);
		virtual BOOL Visit(SupportHanger*& pSH);
		virtual BOOL Visit(Joint*& pJoint);	
		
	private:
		BOOL PersistentJointAttachs(Joint* pJoint);
		BOOL PersistentPartPropertys(SupportHangerSubObject* pPart);
		BOOL PersistentSHParts(SupportHanger* pSH);
	};

	class DllExport PersistentCreateBatch: public PersistentVisitor
	{
	public:
		PersistentCreateBatch();
		virtual ~PersistentCreateBatch();

	public:
		virtual void EndPersistent();

	private:
		void SaveVolume();
		void SaveSH();
		void SaveJoint();
		void SavePart();
		void SaveProperty(PropertySystem::PropertyStack* pStack, const CString& strSHID, const UeObjectId& id);
		void InitPropertyPtr();

	private:
		_RecordsetPtr m_PropertyPtr;
	};
}
#endif // !defined(AFX_PERSISTENTCREATE_H__20D6C800_0398_4241_A305_B1E4EF6BD2F1__INCLUDED_)
